Integrand size = 27, antiderivative size = 205 \[ \int \left (c (d \sec (e+f x))^p\right )^n (a+a \sec (e+f x))^2 \, dx=\frac {2 a^2 \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-\frac {n p}{2},\frac {1}{2} (2-n p),\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f n p \sqrt {\sin ^2(e+f x)}}-\frac {a^2 (1+2 n p) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (1-n p),\frac {1}{2} (3-n p),\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f \left (1-n^2 p^2\right ) \sqrt {\sin ^2(e+f x)}}+\frac {a^2 \left (c (d \sec (e+f x))^p\right )^n \tan (e+f x)}{f (1+n p)} \]
[Out]
Time = 0.30 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {4033, 3873, 3857, 2722, 4131} \[ \int \left (c (d \sec (e+f x))^p\right )^n (a+a \sec (e+f x))^2 \, dx=-\frac {a^2 (2 n p+1) \sin (e+f x) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (1-n p),\frac {1}{2} (3-n p),\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n}{f \left (1-n^2 p^2\right ) \sqrt {\sin ^2(e+f x)}}+\frac {2 a^2 \sin (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-\frac {n p}{2},\frac {1}{2} (2-n p),\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n}{f n p \sqrt {\sin ^2(e+f x)}}+\frac {a^2 \tan (e+f x) \left (c (d \sec (e+f x))^p\right )^n}{f (n p+1)} \]
[In]
[Out]
Rule 2722
Rule 3857
Rule 3873
Rule 4033
Rule 4131
Rubi steps \begin{align*} \text {integral}& = \left ((d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int (d \sec (e+f x))^{n p} (a+a \sec (e+f x))^2 \, dx \\ & = \left ((d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int (d \sec (e+f x))^{n p} \left (a^2+a^2 \sec ^2(e+f x)\right ) \, dx+\frac {\left (2 a^2 (d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int (d \sec (e+f x))^{1+n p} \, dx}{d} \\ & = \frac {a^2 \left (c (d \sec (e+f x))^p\right )^n \tan (e+f x)}{f (1+n p)}+\frac {\left (2 a^2 \left (\frac {\cos (e+f x)}{d}\right )^{n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^{-1-n p} \, dx}{d}+\frac {\left (a^2 (1+2 n p) (d \sec (e+f x))^{-n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int (d \sec (e+f x))^{n p} \, dx}{1+n p} \\ & = \frac {2 a^2 \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-\frac {n p}{2},\frac {1}{2} (2-n p),\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f n p \sqrt {\sin ^2(e+f x)}}+\frac {a^2 \left (c (d \sec (e+f x))^p\right )^n \tan (e+f x)}{f (1+n p)}+\frac {\left (a^2 (1+2 n p) \left (\frac {\cos (e+f x)}{d}\right )^{n p} \left (c (d \sec (e+f x))^p\right )^n\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^{-n p} \, dx}{1+n p} \\ & = \frac {2 a^2 \operatorname {Hypergeometric2F1}\left (\frac {1}{2},-\frac {n p}{2},\frac {1}{2} (2-n p),\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f n p \sqrt {\sin ^2(e+f x)}}-\frac {a^2 (1+2 n p) \cos (e+f x) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (1-n p),\frac {1}{2} (3-n p),\cos ^2(e+f x)\right ) \left (c (d \sec (e+f x))^p\right )^n \sin (e+f x)}{f \left (1-n^2 p^2\right ) \sqrt {\sin ^2(e+f x)}}+\frac {a^2 \left (c (d \sec (e+f x))^p\right )^n \tan (e+f x)}{f (1+n p)} \\ \end{align*}
Time = 0.75 (sec) , antiderivative size = 152, normalized size of antiderivative = 0.74 \[ \int \left (c (d \sec (e+f x))^p\right )^n (a+a \sec (e+f x))^2 \, dx=\frac {a^2 \cot (e+f x) \left (c (d \sec (e+f x))^p\right )^n \left ((1+2 n p) \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {n p}{2},1+\frac {n p}{2},\sec ^2(e+f x)\right ) \sqrt {-\tan ^2(e+f x)}+n p \left (\tan ^2(e+f x)+2 \operatorname {Hypergeometric2F1}\left (\frac {1}{2},\frac {1}{2} (1+n p),\frac {1}{2} (3+n p),\sec ^2(e+f x)\right ) \sec (e+f x) \sqrt {-\tan ^2(e+f x)}\right )\right )}{f n p (1+n p)} \]
[In]
[Out]
\[\int \left (c \left (d \sec \left (f x +e \right )\right )^{p}\right )^{n} \left (a +a \sec \left (f x +e \right )\right )^{2}d x\]
[In]
[Out]
\[ \int \left (c (d \sec (e+f x))^p\right )^n (a+a \sec (e+f x))^2 \, dx=\int { {\left (a \sec \left (f x + e\right ) + a\right )}^{2} \left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n} \,d x } \]
[In]
[Out]
\[ \int \left (c (d \sec (e+f x))^p\right )^n (a+a \sec (e+f x))^2 \, dx=a^{2} \left (\int \left (c \left (d \sec {\left (e + f x \right )}\right )^{p}\right )^{n}\, dx + \int 2 \left (c \left (d \sec {\left (e + f x \right )}\right )^{p}\right )^{n} \sec {\left (e + f x \right )}\, dx + \int \left (c \left (d \sec {\left (e + f x \right )}\right )^{p}\right )^{n} \sec ^{2}{\left (e + f x \right )}\, dx\right ) \]
[In]
[Out]
\[ \int \left (c (d \sec (e+f x))^p\right )^n (a+a \sec (e+f x))^2 \, dx=\int { {\left (a \sec \left (f x + e\right ) + a\right )}^{2} \left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n} \,d x } \]
[In]
[Out]
\[ \int \left (c (d \sec (e+f x))^p\right )^n (a+a \sec (e+f x))^2 \, dx=\int { {\left (a \sec \left (f x + e\right ) + a\right )}^{2} \left (\left (d \sec \left (f x + e\right )\right )^{p} c\right )^{n} \,d x } \]
[In]
[Out]
Timed out. \[ \int \left (c (d \sec (e+f x))^p\right )^n (a+a \sec (e+f x))^2 \, dx=\int {\left (c\,{\left (\frac {d}{\cos \left (e+f\,x\right )}\right )}^p\right )}^n\,{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^2 \,d x \]
[In]
[Out]